package com.soup.lab.validation.anno;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

public class OddLongValidator implements ConstraintValidator<Odd, Long> {
    @Override
    public boolean isValid(Long value, ConstraintValidatorContext context) {
        if(value == null) {
            return true;
        }
        return (value & 1) == 1;
    }
}
